Transition optimization and documentation fixes - #92
Conversation
Uses mask image for CrossDissolve, and adds a new DipTile that draws a tiled dither pattern rather than a full-screen dither. Updates DipToBlack and DipToWhite to use DipTile. For DipTile the max frame rate on hardware improves by 68%, and for CrossDissolve by 59%. Both are noticeably smoother when running games at the SDK default of 30 FPS, and no longer drop below that frame rate unless other expensive computation is happening during the transition. Tested on launch hardware (PDU-Y-01).
… stale doc references. (upstream PR NobleRobot#92) Uses tiled 8x8 dither patterns and image masks (per the SDK's fast_fade.lua technique) for CrossDissolve, and adds a new DipTile base transition used by DipToBlack/DipToWhite, avoiding full-screen 400x240 faded images every frame. Also fixes stale Noble.TransitionType doc references in Noble.lua, README.md, and .docs/modules/Noble.html. Trailing newlines added to CrossDissolve.lua and DipTile.lua. Applies upstream PR NobleRobot#92. Co-authored-by: Alan <Alanaktion@users.noreply.github.com> Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
…ipTile transitions. Cleanups for the DipTile rework from 47f83cf (upstream PR NobleRobot#92): DipToBlack and DipToWhite defined setCustomArguments(), a method that exists nowhere else in the transition hierarchy, so it was never called (and would have crashed calling its nonexistent super method). This left the documented property locks unenforced: passing tilePattern, x, or y to these transitions overrode them, contradicting the "property is locked" note. Rename the overrides to setProperties(), calling the DipTile implementation and then re-asserting the locked values. Also correct DipTile's defaultProperties @table name (a copy-paste from Dip.lua that would collide with Dip's table in generated docs), point the DipToBlack/DipToWhite @see references at DipTile's properties table instead of Dip's (which documents panelImage, a property these transitions no longer read), and rename the display name from "DipTile" to "Dip Tile" to match the spaced naming used by every other transition. Refs upstream PR NobleRobot#92. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Hand-patch the LDoc-generated HTML (as done in d781092 for NobleSprite.html) to cover changes the earlier commits missed: - Noble.html: add the missing sidebar index entry for Noble.performTransition (the body entry was added in 50be77b, but the function was undiscoverable from the nav). - Noble.GameData.html: add sidebar and body entries for resetFromDisk() and resetAllFromDisk() (added in 7aa010a, upstream PR NobleRobot#85). - Noble.Transition.html: replace the stale "panelImage property is locked" notes for DipToBlack/DipToWhite with tilePattern and point their See references at DipTile; add the new DipTile submodule and its defaultProperties table (47f83cf, upstream PR NobleRobot#92); document the per-invocation callback properties on the onStart/onMidpoint/ onHoldTimeElapsed/onComplete entries (50be77b). - NobleScene.html: add the debugColor property, enableDebug/ disableDebug methods, and drawDebug callback (b587cd8, upstream PR NobleRobot#54), plus the gameWillTerminate/deviceWillSleep/deviceWillLock/ deviceDidUnlock callbacks (b034f38, upstream issue NobleRobot#55). Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
… stale doc references. (upstream PR NobleRobot#92) Uses tiled 8x8 dither patterns and image masks (per the SDK's fast_fade.lua technique) for CrossDissolve, and adds a new DipTile base transition used by DipToBlack/DipToWhite, avoiding full-screen 400x240 faded images every frame. Also fixes stale Noble.TransitionType doc references in Noble.lua, README.md, and .docs/modules/Noble.html. Trailing newlines added to CrossDissolve.lua and DipTile.lua. Applies upstream PR NobleRobot#92. Co-authored-by: Alan <Alanaktion@users.noreply.github.com>
…ipTile transitions. Cleanups for the DipTile rework from 47f83cf (upstream PR NobleRobot#92): DipToBlack and DipToWhite defined setCustomArguments(), a method that exists nowhere else in the transition hierarchy, so it was never called (and would have crashed calling its nonexistent super method). This left the documented property locks unenforced: passing tilePattern, x, or y to these transitions overrode them, contradicting the "property is locked" note. Rename the overrides to setProperties(), calling the DipTile implementation and then re-asserting the locked values. Also correct DipTile's defaultProperties @table name (a copy-paste from Dip.lua that would collide with Dip's table in generated docs), point the DipToBlack/DipToWhite @see references at DipTile's properties table instead of Dip's (which documents panelImage, a property these transitions no longer read), and rename the display name from "DipTile" to "Dip Tile" to match the spaced naming used by every other transition. Refs upstream PR NobleRobot#92.
Hand-patch the LDoc-generated HTML (as done in d781092 for NobleSprite.html) to cover changes the earlier commits missed: - Noble.html: add the missing sidebar index entry for Noble.performTransition (the body entry was added in 50be77b, but the function was undiscoverable from the nav). - Noble.GameData.html: add sidebar and body entries for resetFromDisk() and resetAllFromDisk() (added in 7aa010a, upstream PR NobleRobot#85). - Noble.Transition.html: replace the stale "panelImage property is locked" notes for DipToBlack/DipToWhite with tilePattern and point their See references at DipTile; add the new DipTile submodule and its defaultProperties table (47f83cf, upstream PR NobleRobot#92); document the per-invocation callback properties on the onStart/onMidpoint/ onHoldTimeElapsed/onComplete entries (50be77b). - NobleScene.html: add the debugColor property, enableDebug/ disableDebug methods, and drawDebug callback (b587cd8, upstream PR NobleRobot#54), plus the gameWillTerminate/deviceWillSleep/deviceWillLock/ deviceDidUnlock callbacks (b034f38, upstream issue NobleRobot#55).
|
Nice optimization — I integrated it locally and it works well. One pre-existing bug this PR is well-placed to fix, plus two doc nits:
|
Thanks for making this neat li'l engine! It really makes a lot of the initial game dev tasks much easier and I love working with it. I have two small transition-related changes:
Update old TransitionType references
The old TransitionType documentation was still used in a couple of places, so I updated it to reference the new transitions. Also possibly worth changing is that the TransitionType docs page still exists but is not linked to and no longer relevant.
Optimizing transitions with tiled dithers
Based on the Playdate SDK example
fast_fade.luaimplementation, I've updated some of the transitions to use tiled dithers and image masks where possible to improve performance. It uses a tiled mask image for CrossDissolve, and adds a new DipTile that draws a tiled dither pattern rather than a full-screen dither. Updates DipToBlack and DipToWhite to use DipTile. The pattern images used for dithers are 8x8 to allow the larger SDK dither types to tile correctly, but could potentially be a teeny bit faster at 4x4 for the default dips.For DipTile the max frame rate on hardware improves by 68% compared to Dip, and for CrossDissolve by 59% compared to full-screen
drawFaded. Both are noticeably smoother when running games at the SDK default of 30 FPS, and no longer drop below that frame rate unless other expensive computation is happening during the transition. Tested on launch hardware (PDU-Y-01).